package com.lrkj.payfee.service.impl;

import java.util.List;
import com.lrkj.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.lrkj.payfee.mapper.AdvicePaymentDetailMapper;
import com.lrkj.payfee.domain.AdvicePaymentDetail;
import com.lrkj.payfee.service.IAdvicePaymentDetailService;

/**
 * 付款单明细Service业务层处理
 *
 * @author yajun_ren
 * @date 2022-03-26
 */
@Service
public class AdvicePaymentDetailServiceImpl implements IAdvicePaymentDetailService
{
    @Autowired
    private AdvicePaymentDetailMapper advicePaymentDetailMapper;

    /**
     * 查询付款单明细
     *
     * @param id 付款单明细ID
     * @return 付款单明细
     */
    @Override
    public AdvicePaymentDetail selectAdvicePaymentDetailById(String id)
    {
        return advicePaymentDetailMapper.selectAdvicePaymentDetailById(id);
    }

    /**
     * 查询付款单明细列表
     *
     * @param advicePaymentDetail 付款单明细
     * @return 付款单明细
     */
    @Override
    public List<AdvicePaymentDetail> selectAdvicePaymentDetailList(AdvicePaymentDetail advicePaymentDetail)
    {
        return advicePaymentDetailMapper.selectAdvicePaymentDetailList(advicePaymentDetail);
    }

    /**
     * 新增付款单明细
     *
     * @param advicePaymentDetail 付款单明细
     * @return 结果
     */
    @Override
    public int insertAdvicePaymentDetail(AdvicePaymentDetail advicePaymentDetail)
    {
        advicePaymentDetail.setCreateTime(DateUtils.getNowDate());
        return advicePaymentDetailMapper.insertAdvicePaymentDetail(advicePaymentDetail);
    }

    /**
     * 修改付款单明细
     *
     * @param advicePaymentDetail 付款单明细
     * @return 结果
     */
    @Override
    public int updateAdvicePaymentDetail(AdvicePaymentDetail advicePaymentDetail)
    {
        advicePaymentDetail.setUpdateTime(DateUtils.getNowDate());
        return advicePaymentDetailMapper.updateAdvicePaymentDetail(advicePaymentDetail);
    }

    /**
     * 批量删除付款单明细
     *
     * @param ids 需要删除的付款单明细ID
     * @return 结果
     */
    @Override
    public int deleteAdvicePaymentDetailByIds(String[] ids)
    {
        return advicePaymentDetailMapper.deleteAdvicePaymentDetailByIds(ids);
    }

    /**
     * 删除付款单明细信息
     *
     * @param id 付款单明细ID
     * @return 结果
     */
    @Override
    public int deleteAdvicePaymentDetailById(String id)
    {
        return advicePaymentDetailMapper.deleteAdvicePaymentDetailById(id);
    }
    /**
     * 批量新增付款单明细信息
     *
     * @param advicePaymentDetails 付款单明细对象
     */
    public int batchAddData(List<AdvicePaymentDetail> advicePaymentDetails)
    {
           return advicePaymentDetailMapper.batchAddData(advicePaymentDetails);
    }
}
